package com.hdax.dm.rest;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hdax.dm.api.base.LinkUserControllerAPI;
import com.hdax.dm.entity.user.DmLinkUser;
import com.hdax.dm.service.LinkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RestLinkUserService implements LinkUserControllerAPI {

    @Autowired
    private LinkUserService linkUserService;
    @Override
    public List<DmLinkUser> linkUsers(Long userId) {
        return linkUserService.ticketBuyerList(userId);
    }

    @Override
    public DmLinkUser linkUser(Long linkId) {
        QueryWrapper<DmLinkUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",linkId);
        return linkUserService.getOne(queryWrapper);
    }
}
